﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Index.aspx.cs" Inherits="sPodnosom.Views.Home.Index" %>

<asp:Content ID="headContent" ContentPlaceHolderID="HeadContent" runat="server">

    <script src="http://www.google.com/jsapi?key=ABQIAAAAM8H9kHn8qdLNHlqQ-2uTiRSHE4PrNHdkP3rfgkJU0rggmyEOXxTA3AdW0xUp7kXAvwrhzEprQbJjjQ"
        type="text/javascript"></script>

    <script type="text/javascript">
        google.load("maps", "2");

        
    </script>

    <script type="text/javascript">
        var map;
        $(function() {
            if (GBrowserIsCompatible()) {
                map = new GMap2(document.getElementById("map"));
                map.addControl(new GLargeMapControl());
                map.addControl(new GOverviewMapControl());
                map.setCenter(new GLatLng(55.819223, 37.492781), 16);

                GEvent.addListener(map, "click", Map.createMarker);
            }
        });

        var Map = {
            createMarker: function(overlay, latlng) {
                if (latlng) {
                    map.addOverlay(new GMarker(latlng));
                }
            }
        };
    </script>

</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="map" style="width: 600px; height: 550px;">
    </div>
    <% var diningList = (List<sPodnosom.Models.DiningHall>)ViewData["DiningHalls"]; %>
    <% foreach (sPodnosom.Models.DiningHall diningHall in diningList)
       {%>
    <div>
        <%= diningHall.Name %>&nbsp;<%= diningHall.Description %>
    </div>
    <% } %>
</asp:Content>
